package Demo1;


import java.util.PriorityQueue;

class MyTimerTask{
    private long time;//时间戳
    private Runnable runnable;//实际要执行的代码

    public MyTimerTask(Runnable runnable, long delay){//delay 是一个 "相对时间"
        this.runnable = runnable;
        this.time = System.currentTimeMillis()+delay;
    }
    public void run(){
        runnable.run();
    }
}

class   MyTimer{//通过此类 表示定时器
//    负责扫描任务队列 执行队列的线程
    private Thread t = null;

//    任务队列
    private PriorityQueue<MyTimerTask> queue = new PriorityQueue();
}
public class T27 {
    public static void main(String[] args) {

    }
}
